<!-- 问大家 -->
<template>
	<view class="page_box">
		<view class="content_box">
			<view class="ask-div">
				<view class="" v-for="(item,index) in askList" :key="index" @click="setShow(index)">
					<view class="ask-value">
						<view class="ask-title">
              <image src="/static/images/ask.png"></image>
							<view>
								{{item.title}}
							</view>
						</view>
						<view class="ask-num">
							{{item.count}}个回答
						</view>
					</view>
					
					<view class="ask-div2" v-if="item.is_show==1">
						<view class="ask-value2" v-for="(item2,index2) in item.desc_list" :key="index2">
							 <view style="display: flex;margin-bottom: 10rpx;">
                 <image :src="$IMG_URL + item2.d_image" style="width: 50rpx;height: 50rpx;border-radius: 50%;margin-right: 20rpx;"></image>
								<view style="font-size: 30rpx;">{{item2.d_name}}</view>
							 </view>
							 <view>
								{{item2.d_title}}
							 </view>
						</view>
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>

export default {
	components: {
		
	},
	data() {
		return {
			isEmpty: false,
			typeCurrent: 'all',
			askList: [],
			loadStatus: 'loadmore', //loadmore-加载前的状态，loading-加载中的状态，nomore-没有更多的状态
			currentPage: 1,
			lastPage: 1,
		};
	},
	computed: {},
	onLoad() {
		let that = this;
		this.getAskList();
	},
	methods: {
		jump(path, parmas) {
			this.$Router.push({
				path: path,
				query: parmas
			});
		},
		// 问大家
		getAskList() {
			let that = this;
			that.loadStatus = 'loading';
			that.$http('ask.my_ask', {
			}, '加载中...').then(res => {
				if (res.code === 1) {
					that.askList = res.data;
				}
			});
		},
		setShow(index){
			let that = this;
			if(that.askList[index].is_show==0){
				that.askList[index].is_show=1;
			}else{
				that.askList[index].is_show=0;
			}
			
		}
	}
};
</script>

<style lang="scss">
	.page_box{
		background-color:#fff;
		min-height: 100%;
		padding-top: 20rpx;
		padding-bottom: 170rpx;
	}
.empty-box {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
.head_box {
	height: 114rpx;
	background-color:#bebebe;
	padding: 0 20rpx;
	.type-btn {
		width: 130rpx;
		line-height: 62rpx;
		background: rgba(238, 238, 238, 1);
		border-radius: 31rpx;
		border: none;
		font-size: 28rpx;

		font-weight: 400;
		color: rgba(153, 153, 153, 1);
		padding: 0;
		margin-right: 10rpx;
	}
	.btn-active {
		background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
		box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
		color: #444;
	}
}
.comment-list {
	margin-top: 20rpx;
}
//问大家
.ask-div{
	color: #444;
	margin: 41rpx 25rpx 25rpx 25rpx;
	.ask-head{
		display:flex;
		justify-content: space-between;
		font-size: 29rpx;
	}
	.ask-value{
		background-color:#ececec;
		margin: 12rpx 0 12rpx 0;
		padding: 10rpx 27rpx 10rpx 14rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		image{
			width: 42rpx;
			height: 42rpx;
			margin-right: 20rpx;
		}
		.ask-title{
			display: flex;
			align-items: center;
			font-size: 28rpx;
		}
		.ask-num{
			font-size: 17rpx;
		}
	}
}
.ask-div2{
	color: #444;
	margin-left: 20rpx;
	font-size: 22rpx;
	.ask-value2{
		background-color:#bebebe;
		margin-bottom: 10rpx;
		padding: 10rpx;
	}
}

</style>
